package jpf.nextsearch.ds.dao.impl;

import java.util.Date;

import org.hibernate.Query;

import jpf.nextsearch.ds.dao.HostDao;
import jpf.nextsearch.ds.dao.base.AbstractDaoHibernate;
import jpf.nextsearch.ds.model.HostVO;

/**
 * @author <a href="mailto:jacek.pruszkowski@gmail.com">Jacek Pruszkowski</a>
 * 
 */
public class HostDaoImpl extends AbstractDaoHibernate<HostVO> implements HostDao {

	public HostDaoImpl() {
		super(HostVO.class);
	}

	public int removeHostsImportetBefore(Date before) {
		String hql = "delete from HostVO where importDate < :date";
		Query query = getSession().createQuery(hql).setDate("data", before);
		return query.executeUpdate();
	}
}
